<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class Test
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
      
        if($request['name']!=='user' || $request['password'] !== '123456'){
           
            $response = redirect('./create/login');
            echo '账号或者密码错误';
            return $response;
        }else{
            return $next($request);
        };
       
    }

    
}
